﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XYZShell.CSHelper.WinAPI.Usn;

namespace TestWinApi
{
    class Program
    {
        static void Main(string[] args)
        {
            var dr = DriveInfo.GetDrives();
            var urnop = new UsnOperator(dr[1]);
            var fs = urnop.GetEntries();
            File.WriteAllLines("d:\\ef.txt", fs.Where(d=>!d.IsFolder).Select(d => d.FileName).ToArray(), Encoding.UTF8);
            var fs1 = new FileSearch();
            var datas = File.ReadAllLines("d:\\ef.txt");
            //fs.Init(datas);
            DateTime now = DateTime.Now;
            var sRs = fs1.Search(".exe", datas);
            Console.WriteLine((DateTime.Now - now).TotalMilliseconds);
            //foreach (var item in sRs)
            //{
            //    Console.WriteLine(item);
            //}
            Console.WriteLine("End");
            Console.Read();
        }
    }
}
